/**
 * @Author 12629
 * @Description：
 */
public class MyDate {

    //默认的初始值   就地初始化  定义的同时初始化
    public int year;
    //year = 1000; error
    public int month;
    public int day;

    //public boolean flg;

    //public String str;


    public MyDate() {
        this(1900,1,1);
        System.out.println("不带参数的构造方法");
    }

    public MyDate(int year,int month,int day) {
        //this();
        this.year = year;
        this.day = day;
        this.month = month;
        System.out.println("带有3个参数的构造方法！");
    } //alt + insert   快捷键可以自定义


    /*public MyDate(int year, int month, int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }

    public MyDate(int year, int month) {
        this.year = year;
        this.month = month;
    }*/




    public void setDate(int y, int m, int d) {
        this.year = y;
        this.month = m;
        this.day = d;
    }

   /* public void setDate(*//*MyDate this,*//*int year,int month,int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }*/

    public void printDate() {
        System.out.println("year: "+this.year
        + " month: "+this.month +" day: "+this.day);

        //this.test();
    }

    public void test() {
        System.out.println("test()");
    }


    @Override
    public String toString() {
        return "MyDate[" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                ']';
    }
}
